import request from '@/utils/request'

// 查询电源管理列表
export function listElectricity(query) {
  return request({
    url: '/zsw/electricity/list',
    method: 'get',
    params: query
  })
}

// 查询电源管理详细
export function getElectricity(electricityId) {
  return request({
    url: '/zsw/electricity/' + electricityId,
    method: 'get'
  })
}


// 新增电源管理
export function addElectricity(data) {
  return request({
    url: '/zsw/electricity',
    method: 'post',
    data: data
  })
}

// 修改电源管理
export function updateElectricity(data) {
  return request({
    url: '/zsw/electricity',
    method: 'put',
    data: data
  })
}

// 删除电源管理
export function delElectricity(electricityId) {
  return request({
    url: '/zsw/electricity/' + electricityId,
    method: 'delete'
  })
}

export function getDIByDN(DN){
  return request({
    url: 'zsw/electricity/getdi/'+DN,
    method:'get'
  })
}

export function getDNByDI(DI){
  return request({
    url: 'zsw/electricity/getdn/'+DI,
    method:'get'
  })
}
